package com.cino.config.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 日志存储配置属性类
 * 
 * 对应 application.yml 中的配置：
 * ys:
 *   log:
 *     storage:
 *       active: mysql          # 默认激活的存储方式
 *       supports:
 *         - local
 *         - mysql
 *       local:
 *         storage-path: /data/admin/log
 *       mysql:
 *         xxx
 */
@Component
@ConfigurationProperties(prefix = "ys.log.storage")
public class LogStorageProperties {
    
    /**
     * 默认激活的存储方式
     */
    private String active;
    
    /**
     * 支持的存储方式列表
     */
    private List<String> supports;
    
    /**
     * 本地存储配置
     */
    private LocalConfig local;
    
    /**
     * MySQL存储配置
     */
    private MysqlConfig mysql;
    
    public List<String> getSupports() {
        return supports;
    }
    
    public void setSupports(List<String> supports) {
        this.supports = supports;
    }
    
    public String getActive() {
        return active;
    }
    
    public void setActive(String active) {
        this.active = active;
    }
    
    public LocalConfig getLocal() {
        return local;
    }
    
    public void setLocal(LocalConfig local) {
        this.local = local;
    }
    
    public MysqlConfig getMysql() {
        return mysql;
    }
    
    public void setMysql(MysqlConfig mysql) {
        this.mysql = mysql;
    }
    
    /**
     * 本地存储配置类
     */
    public static class LocalConfig {
        /**
         * 本地存储路径
         */
        private String storagePath;
        
        public String getStoragePath() {
            return storagePath;
        }
        
        public void setStoragePath(String storagePath) {
            this.storagePath = storagePath;
        }
    }
    
    /**
     * MySQL存储配置类
     */
    public static class MysqlConfig {
        // 预留MySQL相关配置字段
        // 如：数据源、表名等
        
        public MysqlConfig() {
            // 构造函数
        }
    }
}